package com.essc.service;

import com.essc.pojo.User;
import com.essc.utils.JsonResult;
import org.springframework.boot.configurationprocessor.json.JSONException;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;

public interface UserService {

    //查找所有用户信息（测试用）
    List<User> findAllUserInfo();

    /**
     *
     * 谢明晓 6.24
     */
    //登录
    User login(String username, String password);

    //注册 洪志成改
    Object register(String username, String password,String tel,
                    String Code, HttpServletRequest request);
    /**
     * 陈畅润 6.27
     */
//    //根据id查找用户信息
//    public JsonResult findUserById(User user1);

    //根据id查找用户信息
    public JsonResult findUserById(int uid);

    //根据id修改用户密码(oldPwd表示输入框中的旧密码，newPwd表示新密码)
    public JsonResult updatePwdById(String oldPwd, String newPwd,Integer uid);

    //完善用户信息
    public JsonResult updateUserInfo(User user);

    //上传用户头像
    JsonResult uploadAvatar(MultipartFile file, String username, HttpSession session) throws FileNotFoundException;

    //生成验证码
    String verifyCode(HttpServletResponse resp) throws IOException;

    //充值
    JsonResult recharge(Integer uid, double amount);

}
